<%--
  Created by IntelliJ IDEA.
  User: sxs
  Date: 2020/8/11
  Time: 10:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>公司列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="${AppPath}/css/font.css">
    <link rel="stylesheet" href="${AppPath}/css/index.css">
    <script src="${AppPath}/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${AppPath}/js/index.js"></script>
    <script type="text/javascript" src="${AppPath}/jquery/jquery-2.1.1.min.js"></script>
</head>
<body>
<div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">演示</a>
            <a>
              <cite>导航元素</cite></a>
          </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <input type="hidden" name="uId" value="${sessionScope.user.uid}">
                </div>
                <div class="layui-card-header">

                    <button class="layui-btn" onclick="update()"><i class="layui-icon"></i>修改公司信息</button>
                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <tbody id="companyForm" >

                        </tbody>
                    </table>
                </div>

            </div>
        </div>
    </div>
</div>
</body>
<script>
    function la(){
        layui.use(['laydate','form'], function(){
            var laydate = layui.laydate;
            var  form = layui.form;
            form.render();

        });
    }
    function  update(){
        var uid=$("input[name=uId]").val();

        location.href='${AppPath}/company/updateJump1?companyId='+uid;

    }


    $(function () {
        showList();
    })
    function showList() {
        var uid=$("input[name=uId]").val();
        $.ajax({
            url:"${AppPath}/company/findOne1",
            type:"post",
            data:{"companyId":uid},
            success:function (data) {
                if(data.result=="ok"){
                    let str = "";
                        str += '<tr><th>公司名称</th><td>'+data.company.companyName+'</td></tr>';
                        str += ' <tr><th>公司详情</th><td>'+data.company.companyDetail+'</td></tr>';
                        str += '<tr><th>公司电话</th><td>'+data.company.companyPhone+'</td></tr>';
                        str += '<tr><th>负责就业老师</th><td><input type="hidden" name="empId" value="'+data.emp.empId+'">'+data.emp.empName+'</td> </tr>';
                        str += ' <tr><th>状态</th><td class="td-status"><span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span></td></tr>';
                    $("#companyForm").html(str);
                    la();
                }else{
                    layer.msg(data.result, {time:1000, icon:5}, function(){});
                }
            }
        });
    }


</script>
</html>
